
    import {
        DIC
    } from '@/const/dic';
    import Store from '../../store/';
    const allPermission = Store.state.user.permission;
    const isAdmin = Store.state.user.userInfo.superAdmin;
    export const goodsCategoryTableOption = {
        border: false,
        index: false,
        selection: true,
        calcHeight: 300,
        columnBtn:false,
        searchClearable: false,
        selectClearBtn: false,
        searchResetBtn: false,
        height:"auto",
        menu: true,
        menuAlign: "center",
        searchBtn: true,
        labelWidth: 120,
        refreshBtn: true,
        tip:false,
        addBtn: true,
        dialogWidth: '800px',
        dialogHeight: 'auto',
        menuWidth: 180,
        editBtn: isAdmin || !!allPermission['/admin/goods_category/modify'],
        viewBtn: false,
        delBtn: isAdmin || !!allPermission['/admin/goods_category/category/delete'],
        column: [
    {
        "label": "商品分类名称",
        "prop": "categoryName",
        "search": true,
        "type": "text",
        "fixed": false,
        "width": "auto",
        "row": true,
        "minWidth": "120",
        "readonly": false,
        "span": 20,
        "display": true,
        "hide": false,
        "rules": [
            {
                "required": true,
                "message": "请输入商品分类名称",
                "trigger": "blur"
            }
        ]
    },
    {
        "label": "分类图片",
        "prop": "categoryImg",
        "search": false,
        "type": "upload",
        "fixed": false,
        "width": "auto",
        "row": true,
        "minWidth": "120",
        "readonly": false,
        "span": 12,
        "display": false,
        "hide": true,
        "listType": "picture-img",
        "showFileList": false,
        "imgHeight": 60,
        "imgWidth": "auto",
        "action": "_/admin/upload/image",
        "tip": "只能上传jpg/png文件，且不超过500kb"
    },
    {
        "label": "是否前端显示",
        "prop": "showFlag",
        "search": true,
        "type": "radio",
        "fixed": false,
        "width": "auto",
        "row": true,
        "minWidth": "120",
        "readonly": false,
        "span": 12,
        "display": true,
        "hide": false,
        "rules": [
            {
                "required": true,
                "message": "请选择是否前端显示",
                "trigger": "blur"
            }
        ],
        "placeholder": "请选择是否前端显示",
        "dicData": DIC["YesNo"]
    },
    {
        "label": "封面图片",
        "prop": "categoryImg",
        "search": false,
        "type": "upload",
        "fixed": false,
        "width": "auto",
        "row": false,
        "minWidth": "120",
        "readonly": false,
        "span": 12,
        "display": true,
        "hide": false,
        "listType": "picture-img",
        "showFileList": false,
        "imgHeight": 60,
        "imgWidth": "auto",
        "action": "_/admin/upload/image",
        // "tip": "只能上传jpg/png文件，且不超过500kb,尺寸（300*110）",
        // "rules": [
        //     {
        //         "required": false,
        //         "message": "请上传封面图片",
        //         "trigger": "blur"
        //     }
        // ]
    },
    {
        "label": "父级分类",
        "prop": "parentId",
        "search": false,
        "type": "select",
        "fixed": false,
        "width": "auto",
        "row": true,
        "minWidth": "120",
        "readonly": false,
        "span": 12,
        "display": true,
        props: {
            label: 'categoryName',
            value: 'id'
        },
        dicUrl: '/admin/goods_category/list',
        dicMethod: 'post',
        "hide": false,
        "rules": [
            {
                "required": false,
                "message": "请选择父级分类ID",
                "trigger": "blur"
            }
        ]
    },
    {
        "label": "排序顺序",
        "prop": "sortNum",
        "search": false,
        "type": "number",
        "fixed": false,
        "width": "auto",
        "row": true,
        "minWidth": "120",
        "readonly": false,
        "span": 12,
        "display": true,
        "hide": false,
        "rules": [
            {
                "required": true,
                "message": "请输入排序顺序",
                "trigger": "blur"
            }
        ]
    },
    {
        "label": "创建时间",
        "prop": "createTime",
        "search": false,
        "type": "datetime",
        "fixed": false,
        "width": "170",
        "row": false,
        "readonly": false,
        "span": 12,
        "display": false,
        "hide": false,
        "format": "yyyy-MM-dd HH:mm:ss",
        "valueFormat": "yyyy-MM-dd HH:mm:ss"
    },
    {
        "label": "修改时间",
        "prop": "modifyTime",
        "search": false,
        "type": "datetime",
        "fixed": false,
        "width": "170",
        "row": false,
        "readonly": false,
        "span": 12,
        "display": false,
        "hide": false,
        "format": "yyyy-MM-dd HH:mm:ss",
        "valueFormat": "yyyy-MM-dd HH:mm:ss"
    },
    {
        "label": "创建人",
        "prop": "creator",
        "search": false,
        "type": "text",
        "fixed": false,
        "width": "auto",
        "row": false,
        "minWidth": "120",
        "readonly": false,
        "span": 12,
        "display": false,
        "hide": false
    },
    {
        "label": "修改人",
        "prop": "modifier",
        "search": false,
        "type": "text",
        "fixed": false,
        "width": "auto",
        "row": false,
        "minWidth": "120",
        "readonly": false,
        "span": 12,
        "display": false,
        "hide": false
    }
]
    };
